python get output of command to variable

50

python get output of command to variable -

import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)

Comments

Submit
0 Comments